package module3;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class InformationManagementSystem {

    static StudentList stlist = new StudentList();

    public static void main(String[] args) {

        int i = 0;
        while (0 == i) {
            System.out.println("      学生信息管理系统      ");
            System.out.println("1、增加学生      2、删除学生");
            System.out.println("3、修改学生      4、查找学生");
            System.out.println("5、遍历学生      6、退出系统");
            System.out.println("   ^-^请输入你的操作选项: ");
            Scanner sc = new Scanner(System.in);
            switch (sc.next()) {
                case "1":
                    System.out.println("增加学生的姓名、学号、年龄分别是：");
                    Scanner sc1 = new Scanner(System.in);
                    String stname = sc1.next();
                    String stnumber = sc1.next();
                    int stage = sc1.nextInt();
                    stlist.show1(stname, stnumber, stage);
                    System.out.println("--------------------------------------------------------------");
                    break;
                case "2":
                    stlist.show5();
                    System.out.println("需要删除学生信息的序号为: ");
                    stlist.show2(new Scanner(System.in).nextInt());
                    System.out.println("--------------------------------------------------------------");
                    break;
                case "3":
                    stlist.show5();
                    System.out.println("需要修改的学生序号和修改的学生信息为：");
                    Scanner sc2 = new Scanner(System.in);
                    int i1 = sc2.nextInt();
                    stname = sc2.next();
                    stnumber = sc2.next();
                    stage = sc2.nextInt();
                    stlist.show3(i1, stname, stnumber, stage);
                    System.out.println("--------------------------------------------------------------");
                    break;
                case "4":
                    System.out.println("这位同学的姓名为: ");
                    Object obj = stlist.show4(new Scanner(System.in).next());
                    System.out.println("这位同学是: " + obj);
                    System.out.println("--------------------------------------------------------------");
                    break;
                case "5":
                    stlist.show5();
                    System.out.println("--------------------------------------------------------------");
                    break;
                case "6":
                    i++;
                    System.out.println("即将退出…………欢迎下次使用~^-^~");
                    break;
                default :
                    System.out.println("输入的选项不符合要求哦!");
                    System.out.println("--------------------------------------------------------------");
                    break;
            }
        }
    }
}
